#include"UDPServer.hpp"
#include"Dict.hpp"


int main(int argc,char* argv[])
{
    if(argc!=2)
    {
        cout<<"udp_server port"<<endl;
        return 0;
    }
    Dict d;
    d.InitDict();

    u_int16_t port=atoi(argv[1]);
    UdpServer server(port);
    server.Registration([&d](const string& in,string &out)
    {
        return d.Translation(in,out);
    });

    server.Start();

    server.Stop();

    return 0;
}
